package cn.edu.scau.cmi.wujiaxian.exercise11;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextArea;

public class BorderLayoutPanel extends JPanel{
	private static final long serialVersionUID = 4174621914605686809L;

	JButton s, n, e, w;
	JTextArea c;
	
	public BorderLayoutPanel() {
		setLayout(new BorderLayout()); //东西南北中布局
		s = new JButton("南");
		n = new JButton("北");
		e = new JButton("东");
		w = new JButton("西");
		c = new JTextArea("中");
		add(s, BorderLayout.SOUTH);
		add(n, BorderLayout.NORTH);
		add(e, BorderLayout.EAST);
		add(w, BorderLayout.WEST);
		add(c, BorderLayout.CENTER);
		validate();
	}
	
}
